/**
 * Created by Seven on 2020/5/19.
 */
;
var helper = require("../../javascript/helper");
var db = require("../../javascript/mysql");
var mysql = new db.mysqlClient("accident");
function genProductInfo() {
    plan = {
        "planA": {
            "days": ["3d"],
            "people_count": ["1"],
            "accident_death": ["50000"],
            "acute_death": ["25000"],
            "accident_medical": ["5000"],
            "burial_fee": ["10000"],
            "price": ["5.00"]

        },
        "planB": {
            "days": ["7d"],
            "people_count": ["1"],
            "accident_death": ["100000"],
            "acute_death": ["60000"],
            "accident_medical": ["15000"],
            "burial_fee": ["20000"],
            "price": ["10.00"]

        },
        "planC": {
            "days": ["14d"],
            "people_count": ["1"],
            "accident_death": ["100000"],
            "acute_death": ["60000"],
            "accident_medical": ["15000"],
            "burial_fee": ["20000"],
            "price": ["15.00"]

        }


    };
    for (k in plan){
        data = helper.product([plan[k]["days"],plan[k]["people_count"],plan[k]["accident_death"],plan[k]["acute_death"],plan[k]["accident_medical"],plan[k]["burial_fee"],plan[k]["price"]])
        for(i=0;i<data.length;i++){
            dt = helper.formatProductInfo(data[i],plan[k]);
            dt.name = "安心旅行综合意外伤害保险";
            dt.company = "阳光保险集团";
            mysql.insertData( dt );


        }
    }

}
genProductInfo();
mysql.close();